﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ChungNhanSinhVien.Entities;
using ChungNhanSinhVien.Infrastructures;

namespace ChungNhanSinhVien.Models
{
    public class NhatKyXuLyYeuCauRepository
    {
        Web_ChungNhanSinhVienEntities data;
        public NhatKyXuLyYeuCauRepository()
        {
            //if (data == null)
                data = new Web_ChungNhanSinhVienEntities();
        }
        public void Them(int ycID, string noidung)
        {
            var kq = new NhatKyXuLyYeuCau();
            kq.YeuCauID = ycID;
            kq.AdminID = SessionManager.nsr.ID;
            kq.NoiDung = noidung;
            CNSVStatic.getEntity().AddToNhatKyXuLyYeuCaus(kq);
            CNSVStatic.getEntity().SaveChanges();
        }

        public void ThemNhieu(List<YeuCau> ycList, string noidung)
        {
            foreach (var yc in ycList)
            {
                Them(yc.ID, noidung);
            }
        }
    }
}